package request

import (
	"gitee.com/cjsn/topsdk/ability254/domain"
	"gitee.com/cjsn/topsdk/util"
)

type AlibabaServicecenterWorkcardCreateRequest struct {
	/*
	   服务单id     */
	SpServiceOrderId *int64 `json:"sp_service_order_id" required:"true" `
	/*
	   申请工单时的序号，对应服务单上的serviceSequence。用于控制幂等，防重复提交     */
	ServiceSequence *int64 `json:"service_sequence,omitempty" required:"false" `
	/*
	   申请次数     */
	ServiceCount *int64 `json:"service_count,omitempty" required:"false" `
	/*
	   工单属性，json格式字符串     */
	Attributes *string `json:"attributes,omitempty" required:"false" `
	/*
	   工单外部唯一键单号     */
	OuterId *string `json:"outer_id,omitempty" required:"false" `
	/*
	   服务提供者信息     */
	ServiceProvider *domain.AlibabaServicecenterWorkcardCreateServiceProviderDto `json:"service_provider,omitempty" required:"false" `
}

func (s *AlibabaServicecenterWorkcardCreateRequest) SetSpServiceOrderId(v int64) *AlibabaServicecenterWorkcardCreateRequest {
	s.SpServiceOrderId = &v
	return s
}
func (s *AlibabaServicecenterWorkcardCreateRequest) SetServiceSequence(v int64) *AlibabaServicecenterWorkcardCreateRequest {
	s.ServiceSequence = &v
	return s
}
func (s *AlibabaServicecenterWorkcardCreateRequest) SetServiceCount(v int64) *AlibabaServicecenterWorkcardCreateRequest {
	s.ServiceCount = &v
	return s
}
func (s *AlibabaServicecenterWorkcardCreateRequest) SetAttributes(v string) *AlibabaServicecenterWorkcardCreateRequest {
	s.Attributes = &v
	return s
}
func (s *AlibabaServicecenterWorkcardCreateRequest) SetOuterId(v string) *AlibabaServicecenterWorkcardCreateRequest {
	s.OuterId = &v
	return s
}
func (s *AlibabaServicecenterWorkcardCreateRequest) SetServiceProvider(v domain.AlibabaServicecenterWorkcardCreateServiceProviderDto) *AlibabaServicecenterWorkcardCreateRequest {
	s.ServiceProvider = &v
	return s
}

func (req *AlibabaServicecenterWorkcardCreateRequest) ToMap() map[string]interface{} {
	paramMap := make(map[string]interface{})
	if req.SpServiceOrderId != nil {
		paramMap["sp_service_order_id"] = *req.SpServiceOrderId
	}
	if req.ServiceSequence != nil {
		paramMap["service_sequence"] = *req.ServiceSequence
	}
	if req.ServiceCount != nil {
		paramMap["service_count"] = *req.ServiceCount
	}
	if req.Attributes != nil {
		paramMap["attributes"] = *req.Attributes
	}
	if req.OuterId != nil {
		paramMap["outer_id"] = *req.OuterId
	}
	if req.ServiceProvider != nil {
		paramMap["service_provider"] = util.ConvertStruct(*req.ServiceProvider)
	}
	return paramMap
}

func (req *AlibabaServicecenterWorkcardCreateRequest) ToFileMap() map[string]interface{} {
	fileMap := make(map[string]interface{})
	return fileMap
}
